

class BaseError(Exception):

    message = ''
    code = ''

    def __init__(self, *, message=None, code=None):
        if message:
            self.message = message
        if code:
            self.code = code


class NoDeviceError(BaseError):
    message = '设备未发现'


class DeviceNotConnectError(BaseError):
    message = '设备未连接'


class ParamsError(BaseError):
    message = 'params not correct'
